package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.service.impl.ExportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/export")
public class ExportController extends BaseController {


    @Autowired
    private ExportService exportService;

    /**
     * 变动审核导出
     */
    @Log(title = "变动审核", businessType = BusinessType.EXPORT)
    @GetMapping("/biandongshenhe")
    public void exportBiandongShenhe(String deptid, HttpServletResponse response, HttpServletRequest request,
                                     @RequestParam("shenhezhuangtai") int ppShenhezhuangtai,
                                     @RequestParam("jigoumingcheng") String ppJigoumingcheng,
                                     @RequestParam("zhuanjiaxingming") String ppZhuanjiaxingming,
                                     @RequestParam("renwuxiafashijian1") String ppRenwuxiafashijian1,
                                     @RequestParam("renwuxiafashijian2") String ppRenwuxiafashijian2,
                                     @RequestParam("renwuwanchengshijian1")String ppRenwuwanchengshijian1,
                                     @RequestParam("renwuwanchengshijian2")String ppRenwuwanchengshijian2,
                                     @RequestParam("biandongleixing")String biandongleixing) {
        try {
            exportService.exportBiandongShenhe(deptid, ppShenhezhuangtai, ppJigoumingcheng, ppZhuanjiaxingming,
                    ppRenwuxiafashijian1, ppRenwuxiafashijian2,ppRenwuwanchengshijian1,ppRenwuwanchengshijian2,biandongleixing,response,request);
        } catch (Exception e) {
            logger.info(e.getMessage());
        }
    }

    /**
     * 人事关系转出审核
     */
    @Log(title = "人事关系转出审核", businessType = BusinessType.EXPORT)
    @GetMapping("/renshiguanxizhuanchushenhe")
    public void exportRenshiguanxiZhuanchuShenhe(String deptid, HttpServletResponse response, HttpServletRequest request,
                                                 @RequestParam("shenhezhuangtai") int ppShenhezhuangtai,
                                                 @RequestParam("jigoumingcheng") String ppJigoumingcheng,
                                                 @RequestParam("zhuanjiaxingming") String ppZhuanjiaxingming,
                                                 @RequestParam("renwuxiafashijian1") String ppRenwuxiafashijian1,
                                                 @RequestParam("renwuxiafashijian2") String ppRenwuxiafashijian2,
                                                 @RequestParam("renwuwanchengshijian1")String ppRenwuwanchengshijian1,
                                                 @RequestParam("renwuwanchengshijian2")String ppRenwuwanchengshijian2) {
        try {
            exportService.exportRenshiguanxiZhuanchuShenhe(deptid, ppShenhezhuangtai, ppJigoumingcheng, ppZhuanjiaxingming, ppRenwuxiafashijian1, ppRenwuxiafashijian2,
                    ppRenwuwanchengshijian1,ppRenwuwanchengshijian2,response,request);
        } catch (Exception e) {
            logger.info(e.getMessage());
        }
    }

    /**
     * 专家管理-查询统计导出
     */
    @Log(title = "专家管理-查询统计导出", businessType = BusinessType.EXPORT)
    @GetMapping("/ZhuanjiaguanliChaxuntongji")
    public void exportZhuanjiaguanliChaxuntongji(String deptid, HttpServletResponse response, HttpServletRequest request,
                                                 String zhuanjia,
                                                 String danwei,
                                                 String danweileixing,
                                                 String cengji,
                                                 String gongzuodanwei,
                                                 String guoji,
                                                 String zhengjianleixing,
                                                 String zhengjianhaoma,
                                                 String ruxuannianfen,
                                                 String zhuanjiazhuangtai,
                                                 String zhuanjiazhuangtaibiandongshijian) {
        try {
            exportService.exportZhuanjiaguanliChaxuntongji(deptid,zhuanjia,danwei,danweileixing,cengji,gongzuodanwei,guoji,
                    zhengjianleixing,zhengjianhaoma,ruxuannianfen,zhuanjiazhuangtai,zhuanjiazhuangtaibiandongshijian,response,request);
        } catch (Exception e) {
            logger.info(e.getMessage());
        }
    }

}


